package com.example.riseofthedefender;

import javax.microedition.khronos.opengles.GL10;

public class LazerThing {
	public static void draw(GL10 gl) {
		if(!GameVar.touching)
			return;
		float dis = MyMath.distance(GameVar.touchB, GameVar.touchC);
		gl.glLoadIdentity();
		gl.glColor4f(1.0f, 1.0f, 1.0f, 0.5f);
		//gl.glTranslatef(-Camera.pos.x,-Camera.pos.y,0.0f);
		gl.glTranslatef((GameVar.touchB.x + GameVar.touchC.x)*0.5f, (GameVar.touchB.y + GameVar.touchC.y)*0.5f, 0.0f);
		gl.glRotatef(GameVar.touchAngleD, 0, 0, 1);
		gl.glScalef(dis*0.5f, dis*0.125f, 1.0f);
		
		gl.glBindTexture(GL10.GL_TEXTURE_2D, TextureManager.LAZER.textures[0]);
		gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, Square.vertices.length / 3);
		gl.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
		
	}
}
